home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbdos5
/
form1.frm
< prev
next >
Wrap
Text File
|
1995-12-05
|
8KB
|
276 lines
VERSION 2.00
Begin Form Form1
AutoRedraw = -1 'True
Caption = "MS DOS 5.0 FORMAT"
ClientHeight = 2775
ClientLeft = 525
ClientTop = 2955
ClientWidth = 6510
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 3180
Icon = FORM1.FRX:0000
Left = 465
MousePointer = 1 'Arrow
ScaleHeight = 2775
ScaleWidth = 6510
Top = 2610
Width = 6630
Begin CommandButton fmtit
Caption = "OK"
Enabled = 0 'False
Height = 375
Left = 5160
TabIndex = 8
Top = 2160
Visible = 0 'False
Width = 855
End
Begin TextBox infobox
BackColor = &H00FF0000&
Enabled = 0 'False
Height = 375
Left = 1320
TabIndex = 4
Top = 2160
Width = 3855
End
Begin CommandButton stopit
Caption = "STOP"
Enabled = 0 'False
Height = 375
Left = 480
TabIndex = 9
Top = 2160
Visible = 0 'False
Width = 855
End
Begin CheckBox CheckSd
Caption = "System Disk"
Height = 255
Left = 480
TabIndex = 7
Top = 1680
Width = 1455
End
Begin CheckBox CheckUn
Caption = "Unconditional"
Height = 255
Left = 480
TabIndex = 5
Top = 1440
Width = 1575
End
Begin CheckBox CheckQk
Caption = "Quick Format"
Height = 255
Left = 480
TabIndex = 6
Top = 1200
Width = 1575
End
Begin CommandButton Quickfmt
Caption = "Format"
Default = -1 'True
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 615
Left = 4680
TabIndex = 2
Top = 960
Width = 1335
End
Begin OptionButton Option3
Caption = "3 1/2"
Height = 255
Left = 1320
TabIndex = 12
Top = 960
Visible = 0 'False
Width = 855
End
Begin OptionButton Option5
Caption = "5 1/4"
Height = 255
Left = 480
TabIndex = 11
Top = 960
Value = -1 'True
Visible = 0 'False
Width = 855
End
Begin CheckBox CheckHD
Caption = "High Density"
Height = 255
Left = 480
TabIndex = 3
Top = 720
Value = 1 'Checked
Width = 1455
End
Begin DriveListBox drive1
Height = 315
Left = 2280
TabIndex = 0
Top = 240
Width = 2415
End
Begin Label warn
BackColor = &H000000FF&
Caption = "WARNING ! You may not be formatting a floppy drive ! To protect a hard drive assign it a volume label."
Height = 1215
Left = 2280
TabIndex = 10
Top = 720
Visible = 0 'False
Width = 1935
End
Begin Label Label1
Caption = "Select Drive"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 600
TabIndex = 1
Top = 240
Width = 1575
End
End
Dim hd_ind$, drive$, un$, qk$, sd$, dt$, t%, cmmd$, setfmt$
Sub CheckHD_Click ()
If CheckHD.value = 1 Then
hd_ind$ = "Y"
option3.visible = 0
option5.visible = 0
Else
hd_ind$ = "N"
option3.visible = 1
option5.visible = 1
End If
End Sub
Sub CheckQk_Click ()
If CheckQk.value = 1 Then
qk$ = " /q"
Else
qk$ = ""
End If
End Sub
Sub CheckSd_Click ()
If checkSd.value = 1 Then
sd$ = " /s"
Else
sd$ = ""
End If
End Sub
Sub CheckUn_Click ()
If CheckUn.value = 1 Then
un$ = " /u"
Else
un$ = ""
End If
End Sub
Sub drive1_Change ()
infobox.text = ""
drive$ = drive1.drive
If Len(drive$) > 2 Then
infobox.text = "This is not a floppy drive! Returning to C:."
ChDrive "c:"
drive1.drive = "c:"
drive$ = drive1.drive
warn.visible = 0
GoTo skipit
End If
If drive$ <> "a:" Then
If drive$ <> "b:" Then
warn.visible = 1
End If
Else
warn.visible = 0
End If
skipit:
End Sub
Sub fmtit_Click ()
t% = Shell(cmmd$)
fmtit.visible = 0
fmtit.enabled = 0
stopit.visible = 0
stopit.enabled = 0
Quickfmt.enabled = 1
CheckHD.enabled = 1
CheckQk.enabled = 1
checkSd.enabled = 1
CheckUn.enabled = 1
option5.enabled = 1
option3.enabled = 1
drive1.enabled = 1
cmmd$ = ""
infobox.text = ""
End Sub
Sub Quickfmt_Click ()
If Len(drive$) < 3 And drive$ <> "" Then
infobox.text = ""
cmmd$ = "format.com " + drive$ + qk$ + un$ + sd$
If hd_ind$ = "N" Then
If option3.value Then
cmmd$ = cmmd$ + " /f:720"
Else
cmmd$ = cmmd$ + " /f:360"
End If
End If
infobox.text = cmmd$
fmtit.visible = 1
fmtit.enabled = 1
stopit.visible = 1
stopit.enabled = 1
Quickfmt.enabled = 0
CheckHD.enabled = 0
CheckQk.enabled = 0
checkSd.enabled = 0
CheckUn.enabled = 0
option3.enabled = 0
option5.enabled = 0
drive1.enabled = 0
Else
infobox.text = "Please pick a floppy drive!"
End If
End Sub
Sub stopit_Click ()
fmtit.visible = 0
fmtit.enabled = 0
stopit.visible = 0
stopit.enabled = 0
Quickfmt.enabled = 1
CheckHD.enabled = 1
CheckQk.enabled = 1
checkSd.enabled = 1
CheckUn.enabled = 1
option5.enabled = 1
option3.enabled = 1
drive1.enabled = 1
cmmd$ = ""
infobox.text = ""
End Sub